<html>
<head>
    <title>Locator.js Source Code | Sencha Test 1.0.3</title>
    <!--  Generated on  -->
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="css/styles.css">
</head>
<body>
    <pre class="editor editor-colors"><div class="line"><a name="line1"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line2"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@class</span></span><span>&nbsp;ST.Locator</span></span></span></div><div class="line"><a name="line3"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;@singleton</span></span></span></div><div class="line"><a name="line4"><a name="ST.Locator"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line5"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Sencha&nbsp;Test&nbsp;provides&nbsp;multiple&nbsp;ways&nbsp;to&nbsp;locate&nbsp;an&nbsp;element&nbsp;from&nbsp;a&nbsp;text&nbsp;string.&nbsp;The&nbsp;best</span></span></span></div><div class="line"><a name="line6"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;and&nbsp;most&nbsp;reliable&nbsp;way&nbsp;to&nbsp;locate&nbsp;elements&nbsp;will&nbsp;be&nbsp;application-specific,&nbsp;so&nbsp;Sencha&nbsp;Test</span></span></span></div><div class="line"><a name="line7"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;generalizes&nbsp;the&nbsp;tools&nbsp;needed&nbsp;in&nbsp;what&nbsp;are&nbsp;called&nbsp;&quot;locators&quot;.</span></span></span></div><div class="line"><a name="line8"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line9"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;A&nbsp;locator&nbsp;solves&nbsp;the&nbsp;same&nbsp;probelm&nbsp;as&nbsp;a&nbsp;CSS&nbsp;selector&nbsp;but&nbsp;is&nbsp;a&nbsp;super-set&nbsp;of&nbsp;CSS&nbsp;selector</span></span></span></div><div class="line"><a name="line10"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;syntax.&nbsp;The&nbsp;locator&nbsp;syntax&nbsp;is&nbsp;more&nbsp;expressive&nbsp;than&nbsp;selectors&nbsp;to&nbsp;provide&nbsp;more&nbsp;options</span></span></span></div><div class="line"><a name="line11"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;for&nbsp;testing&nbsp;real-world&nbsp;applications.</span></span></span></div><div class="line"><a name="line12"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line13"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;When&nbsp;testing&nbsp;applications,&nbsp;ideally&nbsp;the&nbsp;application&nbsp;developers&nbsp;provide&nbsp;a&nbsp;reliable&nbsp;way</span></span></span></div><div class="line"><a name="line14"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;for&nbsp;testers&nbsp;to&nbsp;locate&nbsp;application&nbsp;components&nbsp;and&nbsp;elements.</span></span></span></div><div class="line"><a name="line15"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line16"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Locators&nbsp;appear&nbsp;in&nbsp;the&nbsp;{@link&nbsp;ST.event.Playable#target&nbsp;target}&nbsp;property&nbsp;of&nbsp;records</span></span></span></div><div class="line"><a name="line17"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;passed&nbsp;to&nbsp;{@link&nbsp;ST#play}.&nbsp;Locators&nbsp;can&nbsp;be&nbsp;passed&nbsp;to&nbsp;{@link&nbsp;ST#find}&nbsp;to&nbsp;find&nbsp;an</span></span></span></div><div class="line"><a name="line18"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;{@link&nbsp;ST.Element&nbsp;element}.&nbsp;Locators&nbsp;are&nbsp;also&nbsp;passed&nbsp;to&nbsp;{@link&nbsp;ST#element}&nbsp;to&nbsp;create</span></span></span></div><div class="line"><a name="line19"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;{@link&nbsp;ST.future.Element&nbsp;future&nbsp;elements}&nbsp;and&nbsp;{@link&nbsp;ST#component}&nbsp;to&nbsp;create</span></span></span></div><div class="line"><a name="line20"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;{@link&nbsp;ST.future.Component&nbsp;future&nbsp;components}.</span></span></span></div><div class="line"><a name="line21"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line22"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;##&nbsp;Locating&nbsp;Elements</span></span></span></div><div class="line"><a name="line23"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line24"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;###&nbsp;At-Path</span></span></span></div><div class="line"><a name="line25"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Locators&nbsp;that&nbsp;start&nbsp;with&nbsp;the&nbsp;&quot;@&quot;&nbsp;character&nbsp;are&nbsp;called&nbsp;&quot;at-paths&quot;.&nbsp;The&nbsp;first&nbsp;token&nbsp;of</span></span></span></div><div class="line"><a name="line26"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;an&nbsp;at-path&nbsp;is&nbsp;an&nbsp;element&nbsp;ID.&nbsp;Following&nbsp;the&nbsp;first&nbsp;token&nbsp;is&nbsp;a&nbsp;slash-delimited&nbsp;sequence</span></span></span></div><div class="line"><a name="line27"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;of&nbsp;tag&nbsp;names&nbsp;and&nbsp;offsets,&nbsp;similar&nbsp;to&nbsp;XPath.&nbsp;For&nbsp;example:</span></span></span></div><div class="line"><a name="line28"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line29"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@some-div/span[2]</span></span></span></div><div class="line"><a name="line30"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line31"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;This&nbsp;identifies&nbsp;the&nbsp;2nd&nbsp;&quot;span&quot;&nbsp;element&nbsp;that&nbsp;is&nbsp;an&nbsp;immediate&nbsp;child&nbsp;of&nbsp;the&nbsp;element&nbsp;with</span></span></span></div><div class="line"><a name="line32"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;the&nbsp;id&nbsp;&quot;some-div&quot;.&nbsp;The&nbsp;equivalent&nbsp;XPath&nbsp;expression&nbsp;would&nbsp;be:</span></span></span></div><div class="line"><a name="line33"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line34"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//[@id=&quot;some-div&quot;]/span[2]</span></span></span></div><div class="line"><a name="line35"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line36"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;primary&nbsp;advantages&nbsp;of&nbsp;at-paths&nbsp;over&nbsp;XPath&nbsp;are&nbsp;compactness&nbsp;and&nbsp;speed.&nbsp;This&nbsp;is&nbsp;because</span></span></span></div><div class="line"><a name="line37"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;an&nbsp;at-path&nbsp;uses&nbsp;`getElementById`&nbsp;followed&nbsp;by&nbsp;a&nbsp;simple&nbsp;path&nbsp;based&nbsp;on&nbsp;tag&nbsp;names.&nbsp;Because</span></span></span></div><div class="line"><a name="line38"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;at-paths&nbsp;are&nbsp;inherently&nbsp;based&nbsp;on&nbsp;ID&#39;s,&nbsp;they&nbsp;will&nbsp;be&nbsp;most&nbsp;useful&nbsp;in&nbsp;applications&nbsp;that</span></span></span></div><div class="line"><a name="line39"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;assign&nbsp;meaningful&nbsp;ID&#39;s&nbsp;to&nbsp;their&nbsp;components.</span></span></span></div><div class="line"><a name="line40"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line41"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;###&nbsp;XPath</span></span></span></div><div class="line"><a name="line42"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;XPath&nbsp;is&nbsp;probably&nbsp;the&nbsp;most&nbsp;powerful&nbsp;supported&nbsp;locator&nbsp;syntax.&nbsp;Sencha&nbsp;Test&nbsp;uses&nbsp;the</span></span></span></div><div class="line"><a name="line43"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;[document.evaluate](</span><span class="markup underline link http hyperlink"><span>http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-evaluate</span></span><span>)</span></span></span></div><div class="line"><a name="line44"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;method&nbsp;of&nbsp;the&nbsp;browser,&nbsp;but&nbsp;also&nbsp;a&nbsp;[polyfill](</span><span class="markup underline link https hyperlink"><span>https://github.com/google/wicked-good-xpath</span></span><span>)</span></span></span></div><div class="line"><a name="line45"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;when&nbsp;this&nbsp;method&nbsp;is&nbsp;not&nbsp;present.</span></span></span></div><div class="line"><a name="line46"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line47"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;In&nbsp;addition&nbsp;to&nbsp;attribute&nbsp;matching,&nbsp;XPath&nbsp;can&nbsp;also&nbsp;navigate&nbsp;upwards,&nbsp;unlike&nbsp;CSS</span></span></span></div><div class="line"><a name="line48"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;selectors.&nbsp;For&nbsp;example:</span></span></span></div><div class="line"><a name="line49"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line50"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//[id=&quot;some-div&quot;]/..</span></span></span></div><div class="line"><a name="line51"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line52"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;above&nbsp;XPath&nbsp;selects&nbsp;the&nbsp;parent&nbsp;node&nbsp;of&nbsp;the&nbsp;node&nbsp;having&nbsp;ID&nbsp;of&nbsp;&quot;some-div&quot;.</span></span></span></div><div class="line"><a name="line53"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line54"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**IMPORTANT**&nbsp;Sencha&nbsp;Test&nbsp;requires&nbsp;that&nbsp;all&nbsp;XPath&nbsp;locators&nbsp;start&nbsp;with&nbsp;a&nbsp;slash&nbsp;character.</span></span></span></div><div class="line"><a name="line55"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Typically&nbsp;XPath&nbsp;locators&nbsp;will&nbsp;begin&nbsp;with&nbsp;&quot;//&quot;&nbsp;(as&nbsp;shown&nbsp;above)&nbsp;so&nbsp;that&nbsp;matches&nbsp;do&nbsp;not</span></span></span></div><div class="line"><a name="line56"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;start&nbsp;at&nbsp;the&nbsp;document&nbsp;root.</span></span></span></div><div class="line"><a name="line57"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line58"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Some&nbsp;useful&nbsp;resources&nbsp;on&nbsp;XPath:</span></span></span></div><div class="line"><a name="line59"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line60"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;*&nbsp;[DOM&nbsp;XPath&nbsp;Specification](</span><span class="markup underline link http hyperlink"><span>http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html</span></span><span>)</span></span></span></div><div class="line"><a name="line61"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;*&nbsp;[XPath&nbsp;and&nbsp;CSS&nbsp;Selectors](</span><span class="markup underline link http hyperlink"><span>http://ejohn.org/blog/xpath-css-selectors/</span></span><span>)</span></span></span></div><div class="line"><a name="line62"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line63"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;###&nbsp;DOM&nbsp;Query</span></span></span></div><div class="line"><a name="line64"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;DOM&nbsp;Query,&nbsp;or&nbsp;CSS&nbsp;Selector,&nbsp;is&nbsp;perhaps&nbsp;the&nbsp;most&nbsp;familiar&nbsp;locator&nbsp;syntax&nbsp;supported</span></span></span></div><div class="line"><a name="line65"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;by&nbsp;Sencha&nbsp;Test.&nbsp;To&nbsp;differentiate&nbsp;DOM&nbsp;Query&nbsp;locators&nbsp;from&nbsp;the&nbsp;Component&nbsp;and&nbsp;Composite</span></span></span></div><div class="line"><a name="line66"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Queries&nbsp;(discussed&nbsp;below),&nbsp;a&nbsp;DOM&nbsp;Query&nbsp;starts&nbsp;with&nbsp;&quot;&gt;&gt;&quot;&nbsp;or&nbsp;&quot;=&gt;&quot;.</span></span></span></div><div class="line"><a name="line67"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line68"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;above&nbsp;paths&nbsp;would&nbsp;be&nbsp;approximated&nbsp;by&nbsp;the&nbsp;following&nbsp;DOM&nbsp;Query:</span></span></span></div><div class="line"><a name="line69"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line70"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt;&gt;&nbsp;#some-div&nbsp;&gt;&nbsp;span:nth-child(2)</span></span></span></div><div class="line"><a name="line71"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line72"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;This&nbsp;is&nbsp;only&nbsp;approximately&nbsp;the&nbsp;same&nbsp;because&nbsp;`nth-child()`&nbsp;does&nbsp;not&nbsp;require&nbsp;the&nbsp;first</span></span></span></div><div class="line"><a name="line73"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;child&nbsp;to&nbsp;also&nbsp;be&nbsp;a&nbsp;`span`.</span></span></span></div><div class="line"><a name="line74"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line75"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;##&nbsp;Locating&nbsp;Components</span></span></span></div><div class="line"><a name="line76"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;When&nbsp;testing&nbsp;applications&nbsp;built&nbsp;using&nbsp;Sencha&nbsp;frameworks&nbsp;(Ext&nbsp;JS&nbsp;and&nbsp;Sencha&nbsp;Touch),&nbsp;the</span></span></span></div><div class="line"><a name="line77"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;majority&nbsp;of&nbsp;logic&nbsp;operates&nbsp;at&nbsp;a&nbsp;layer&nbsp;above&nbsp;elements:&nbsp;Components.&nbsp;It&nbsp;is&nbsp;therefore&nbsp;more</span></span></span></div><div class="line"><a name="line78"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;desirable&nbsp;to&nbsp;locate&nbsp;and&nbsp;operate&nbsp;on&nbsp;components&nbsp;than&nbsp;raw&nbsp;DOM&nbsp;elements.</span></span></span></div><div class="line"><a name="line79"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line80"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;###&nbsp;Component&nbsp;Query</span></span></span></div><div class="line"><a name="line81"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&quot;[Component&nbsp;Query](</span><span class="markup underline link http hyperlink"><span>http://docs.sencha.com/extjs/6.0/6.0.1-classic/</span></span><span>#!/api/Ext.ComponentQuery)&quot;</span></span></span></div><div class="line"><a name="line82"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;is&nbsp;a&nbsp;feature&nbsp;provided&nbsp;by&nbsp;Sencha&nbsp;frameworks&nbsp;that&nbsp;can&nbsp;locate&nbsp;components&nbsp;of&nbsp;the&nbsp;application.</span></span></span></div><div class="line"><a name="line83"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Component&nbsp;Query&nbsp;syntax&nbsp;is&nbsp;essentially&nbsp;the&nbsp;same&nbsp;as&nbsp;DOM&nbsp;Query.</span></span></span></div><div class="line"><a name="line84"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line85"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Consider:</span></span></span></div><div class="line"><a name="line86"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line87"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#some-component</span></span></span></div><div class="line"><a name="line88"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line89"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;above&nbsp;will&nbsp;locate&nbsp;a&nbsp;Component&nbsp;with&nbsp;an&nbsp;`id`&nbsp;or&nbsp;`itemId`&nbsp;property&nbsp;of&nbsp;&quot;some-component&quot;.</span></span></span></div><div class="line"><a name="line90"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line91"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;###&nbsp;Composite&nbsp;Query</span></span></span></div><div class="line"><a name="line92"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Finally,&nbsp;you&nbsp;can&nbsp;combine&nbsp;Component&nbsp;Query&nbsp;and&nbsp;DOM&nbsp;Query&nbsp;in&nbsp;a&nbsp;&quot;Composite&nbsp;Query&quot;&nbsp;by&nbsp;using</span></span></span></div><div class="line"><a name="line93"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;the&nbsp;&quot;=&gt;&quot;&nbsp;to&nbsp;separate&nbsp;the&nbsp;two&nbsp;pieces.</span></span></span></div><div class="line"><a name="line94"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line95"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;For&nbsp;example:</span></span></span></div><div class="line"><a name="line96"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line97"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#some-component&nbsp;=&gt;&nbsp;div.foo</span></span></span></div><div class="line"><a name="line98"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line99"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;This&nbsp;locates&nbsp;the&nbsp;child&nbsp;&quot;div&quot;&nbsp;with&nbsp;class&nbsp;&quot;foo&quot;&nbsp;inside&nbsp;the&nbsp;component&nbsp;with&nbsp;`id`&nbsp;(or&nbsp;`itemId`)</span></span></span></div><div class="line"><a name="line100"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;of&nbsp;&quot;some-component&quot;.</span></span></span></div><div class="line"><a name="line101"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line102"><span class="source js"><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>Locator</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="meta function js"><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>Locator</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></div><div class="line"><a name="line103"><span class="source js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>apply</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>Locator</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line104"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tagPathRegEx</span><span class="keyword operator js"><span>:</span></span><span class="string regexp js"><span>&nbsp;</span><span class="punctuation definition string begin js"><span>/</span></span><span class="meta group regexp"><span class="punctuation definition group regexp"><span>(</span></span><span class="constant character character-class regexp"><span>\w</span></span><span class="keyword operator quantifier regexp"><span>+</span></span><span class="punctuation definition group regexp"><span>)</span><span>(?:</span></span><span class="constant character escape backslash regexp"><span>\[</span></span><span class="meta group regexp"><span class="punctuation definition group regexp"><span>(</span></span><span class="constant character character-class regexp"><span>\d</span></span><span class="keyword operator quantifier regexp"><span>+</span></span><span class="punctuation definition group regexp"><span>)</span></span></span><span class="constant character escape backslash regexp"><span>\]</span></span><span class="punctuation definition group regexp"><span>)</span></span></span><span class="keyword operator quantifier regexp"><span>?</span></span><span class="punctuation definition string end js"><span>/</span></span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line105"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;atPathRe</span><span class="keyword operator js"><span>:</span></span><span class="string regexp js"><span>&nbsp;</span><span class="punctuation definition string begin js"><span>/</span></span><span class="keyword control anchor regexp"><span>^</span></span><span>@</span><span class="punctuation definition string end js"><span>/</span></span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line106"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xpathRe</span><span class="keyword operator js"><span>:</span></span><span class="string regexp js"><span>&nbsp;</span><span class="punctuation definition string begin js"><span>/</span></span><span class="keyword control anchor regexp"><span>^</span></span><span class="constant character escape backslash regexp"><span>\/</span></span><span class="punctuation definition string end js"><span>/</span></span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line107"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line108"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="support class js"><span>window</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line109"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line110"><a name="ST.Locator-method-find"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></span></span></div><div class="line"><a name="line111"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Given&nbsp;the&nbsp;`target`&nbsp;locator&nbsp;string,&nbsp;return&nbsp;the&nbsp;matching&nbsp;element&nbsp;or&nbsp;`null`&nbsp;if&nbsp;one</span></span></span></span></span></div><div class="line"><a name="line112"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;is&nbsp;not&nbsp;found.&nbsp;See&nbsp;{@link&nbsp;ST.Locator}&nbsp;for&nbsp;a&nbsp;description&nbsp;of&nbsp;valid&nbsp;locator</span></span></span></span></span></div><div class="line"><a name="line113"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;strings.</span></span></span></span></span></div><div class="line"><a name="line114"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></span></span></span></span></div><div class="line"><a name="line115"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;See&nbsp;also&nbsp;the&nbsp;short-hand&nbsp;equivalent&nbsp;{@link&nbsp;ST#find}.</span></span></span></span></span></div><div class="line"><a name="line116"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></span></span></span></span></div><div class="line"><a name="line117"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{String/Function}&nbsp;target&nbsp;The&nbsp;target&nbsp;locator&nbsp;string&nbsp;or&nbsp;a&nbsp;function&nbsp;that</span></span></span></span></span></div><div class="line"><a name="line118"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;returns&nbsp;the&nbsp;DOM&nbsp;node.</span></span></span></span></span></div><div class="line"><a name="line119"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{Boolean}&nbsp;[wrap]&nbsp;Pass&nbsp;`true`&nbsp;to&nbsp;return&nbsp;a&nbsp;wrapped&nbsp;{@link&nbsp;ST.Element}</span></span></span></span></span></div><div class="line"><a name="line120"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;instead&nbsp;of&nbsp;the&nbsp;raw&nbsp;DOM&nbsp;node.</span></span></span></span></span></div><div class="line"><a name="line121"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{HTMLElement/ST.Element/Ext.Component}&nbsp;[root]</span></span></span></span></span></div><div class="line"><a name="line122"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{&quot;down&quot;/&quot;up&quot;/&quot;child&quot;/&quot;sibling?&quot;}&nbsp;[direction=&quot;down&quot;]</span></span></span></span></span></div><div class="line"><a name="line123"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;currently&nbsp;only&nbsp;used&nbsp;for&nbsp;composite&nbsp;queries</span></span></span></span></span></div><div class="line"><a name="line124"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></span></span></div><div class="line"><a name="line125"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>find</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>target</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>wrap</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>root</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>direction</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line126"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;el</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line127"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line128"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="keyword operator typeof js"><span>typeof</span></span><span>&nbsp;target&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>function</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line129"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta function-call js"><span class="entity name function js"><span>target</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line130"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line131"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>Locator</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>atPathRe</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>test</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>target</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line132"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>Locator</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>atPath</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>target</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line133"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line134"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>Locator</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>xpathRe</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>test</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>target</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line135"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>Locator</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>xpath</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>target</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line136"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line137"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line138"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>Locator</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>composite</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>target</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;root</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;direction</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line139"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line140"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line141"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>el&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;wrap</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line142"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta class instance constructor"><span class="keyword operator new js"><span>new</span></span><span>&nbsp;</span><span class="entity name type instance js"><span>ST.Element</span></span></span><span class="meta brace round js"><span>(</span></span><span>el</span><span class="meta brace round js"><span>)</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line143"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line144"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line145"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;el</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line146"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line147"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line148"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>atPath</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>path</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line149"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;parts&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>path</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>split</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>/</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line150"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;regex&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>Locator</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>tagPathRegEx</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line151"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;n</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;m</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;count</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;tag</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;child</span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line152"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>Locator</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>document</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line153"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line154"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>parts</span><span class="meta brace square js"><span>[</span></span><span class="constant numeric decimal js"><span>0</span></span><span class="meta brace square js"><span>]</span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>==</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>@</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="keyword operator js"><span>?</span></span><span>&nbsp;</span><span class="variable other object js"><span>el</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>body</span></span></span></span></span></div><div class="line"><a name="line155"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="variable other object js"><span>el</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function dom js"><span>getElementById</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>parts</span><span class="meta brace square js"><span>[</span></span><span class="constant numeric decimal js"><span>0</span></span><span class="meta brace square js"><span>]</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>substring</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="constant numeric decimal js"><span>1</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;</span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;remove&nbsp;&#39;@&#39;</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line156"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line157"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>for</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>i&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;n&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>parts</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>length</span></span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;el&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;i&nbsp;</span><span class="keyword operator comparison js"><span>&lt;</span></span><span>&nbsp;n</span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;</span><span class="keyword operator increment js"><span>++</span></span><span>i</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line158"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>regex</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>exec</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>parts</span><span class="meta brace square js"><span>[</span></span><span>i</span><span class="meta brace square js"><span>]</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line159"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;m</span><span class="meta brace square js"><span>[</span></span><span class="constant numeric decimal js"><span>2</span></span><span class="meta brace square js"><span>]</span></span><span>&nbsp;</span><span class="keyword operator js"><span>?</span></span><span>&nbsp;</span><span class="meta function-call js"><span class="support function js"><span>parseInt</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>m</span><span class="meta brace square js"><span>[</span></span><span class="constant numeric decimal js"><span>2</span></span><span class="meta brace square js"><span>]</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>10</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line160"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tag&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;m</span><span class="meta brace square js"><span>[</span></span><span class="constant numeric decimal js"><span>1</span></span><span class="meta brace square js"><span>]</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>toUpperCase</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line161"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line162"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>for</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>child&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>el</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>firstChild</span></span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;child</span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;child&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>child</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>nextSibling</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line163"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>child</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>tagName</span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>==</span></span><span>&nbsp;tag</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line164"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>count&nbsp;</span><span class="keyword operator comparison js"><span>==</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line165"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>break</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line166"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line167"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword operator decrement js"><span>--</span></span><span>count</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line168"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line169"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line170"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line171"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;child</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line172"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line173"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line174"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;el</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line175"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line176"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line177"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>composite</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>target</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>queryRoot</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>direction</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line178"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;me&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line179"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>_parseRoot</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>queryRoot</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line180"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;compContext&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>context</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>comp</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line181"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;elContext&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>context</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line182"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>context</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>root</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line183"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parsedTarget&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>_parseSelector</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>target</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable other object js"><span>context</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>type</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line184"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domQuery&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>parsedTarget</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>domQuery</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line185"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;compQuery&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>parsedTarget</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>compQuery</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line186"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;isComposite&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>parsedTarget</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>isComposite</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line187"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;direction&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;direction&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>down</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line188"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comp</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line189"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line190"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;if&nbsp;this&nbsp;is&nbsp;a&nbsp;composite&nbsp;query&nbsp;of&nbsp;the&nbsp;&quot;up&quot;&nbsp;or&nbsp;&quot;child&quot;&nbsp;variety</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line191"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>isComposite&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;compContext&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;direction&nbsp;</span><span class="keyword operator comparison js"><span>!==</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>down</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line192"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>_doCompositeQuery</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>compQuery</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;domQuery</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;compContext</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;direction</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line193"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line194"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;if&nbsp;we&nbsp;failed&nbsp;to&nbsp;resolve&nbsp;the&nbsp;requested&nbsp;root,&nbsp;we&nbsp;can&nbsp;skip&nbsp;the&nbsp;rest</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line195"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>context</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>failedRoot</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line196"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line197"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line198"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;if&nbsp;a&nbsp;component&nbsp;query&nbsp;was&nbsp;detected,&nbsp;run&nbsp;first&nbsp;to&nbsp;determine&nbsp;root</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line199"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>compQuery</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line200"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;compContext&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line201"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line202"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comp&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>_doComponentQuery</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>compQuery</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;root</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;direction</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;&nbsp;</span></span></span></span></div><div class="line"><a name="line203"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line204"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;comp&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>comp</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="variable other object js"><span>comp</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>element</span></span><span class="meta brace round js"><span>)</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line205"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;root&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>dom</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line206"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="keyword operator logical js"><span>!</span></span><span>domQuery</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line207"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line208"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line209"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line210"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>domQuery&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;root</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line211"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>_doDomQuery</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>domQuery</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;root</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;direction</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line212"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line213"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line214"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line215"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;root</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line216"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line217"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line218"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>xpath</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>target</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line219"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;doc&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>Locator</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>document</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line220"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;res&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>doc</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>evaluate</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>target</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;doc</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>5</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;ORDERED_NODE_ITERATOR_TYPE</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line221"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;res&nbsp;</span><span class="keyword operator js"><span>?</span></span><span>&nbsp;</span><span class="variable other object js"><span>res</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>iterateNext</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line222"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line223"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>el&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>options</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>failOnMultipleMatches</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="variable other object js"><span>res</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>iterateNext</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line224"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>throw</span></span><span>&nbsp;</span><span class="meta class instance constructor"><span class="keyword operator new js"><span>new</span></span><span>&nbsp;</span><span class="entity name type instance js"><span>Error</span></span></span><span class="meta brace round js"><span>(</span></span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>XPath&nbsp;locator&nbsp;matches&nbsp;multiple&nbsp;items:&nbsp;&quot;</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span>&nbsp;</span><span class="keyword operator js"><span>+</span></span><span>&nbsp;target&nbsp;</span><span class="keyword operator js"><span>+</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>&quot;</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line225"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line226"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line227"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;el</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line228"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line229"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line230"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></span></span></div><div class="line"><a name="line231"><a name="ST.Locator-method-_doCompositeQuery"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@private</span></span></span></span></span></span></div><div class="line"><a name="line232"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Executes&nbsp;composite&nbsp;query&nbsp;for&nbsp;hierarchy&nbsp;requests</span></span></span></span></span></div><div class="line"><a name="line233"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{String}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>compQuery</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;Component&nbsp;query</span></span></span></span></span></span></span></div><div class="line"><a name="line234"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{String}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>domQuery</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;DOM&nbsp;query</span></span></span></span></span></span></span></div><div class="line"><a name="line235"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{Ext.Component}&nbsp;root&nbsp;The&nbsp;root&nbsp;component</span></span></span></span></span></div><div class="line"><a name="line236"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{String}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>direction</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;direction&nbsp;of&nbsp;the&nbsp;hierarchical&nbsp;query</span></span></span></span></span></span></span></div><div class="line"><a name="line237"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{String}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>start</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;id&nbsp;of&nbsp;the&nbsp;original&nbsp;starting&nbsp;context</span></span></span></span></span></span></span></div><div class="line"><a name="line238"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;{HTMLElement}</span></span></span></span></span></div><div class="line"><a name="line239"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></span></span></div><div class="line"><a name="line240"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>_doCompositeQuery</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>compQuery</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>domQuery</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>root</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>direction</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>start</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line241"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;me&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line242"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;start&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;root</span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line243"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;originalRoot</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;el</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;matches</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;match</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;comp</span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line244"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;node</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;verified</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;rootEl</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;parent</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line245"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line246"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>direction&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>up</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line247"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;first,&nbsp;run&nbsp;component&nbsp;query&nbsp;side&nbsp;of&nbsp;composite</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line248"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comp&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>up</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>compQuery</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line249"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line250"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>comp</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line251"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;we&nbsp;have&nbsp;a&nbsp;match,&nbsp;so&nbsp;run&nbsp;dom&nbsp;query&nbsp;portion</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line252"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>comp</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="variable other object js"><span>comp</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>element</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line253"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>fly</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>el</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>down</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>domQuery</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="constant language boolean true js"><span>true</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line254"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;verified&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language boolean false js"><span>false</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line255"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line256"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>match</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line257"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;Here&#39;s&nbsp;where&nbsp;it&nbsp;gets&nbsp;interesting;&nbsp;we&nbsp;found&nbsp;a&nbsp;match,&nbsp;but&nbsp;it&nbsp;could&nbsp;be&nbsp;*anywhere*&nbsp;in&nbsp;the&nbsp;hierarchy</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line258"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;of&nbsp;the&nbsp;matched&nbsp;component;&nbsp;so,&nbsp;we&nbsp;need&nbsp;to&nbsp;work&nbsp;our&nbsp;way&nbsp;from&nbsp;the&nbsp;bottom&nbsp;(original&nbsp;node)&nbsp;to&nbsp;the&nbsp;top&nbsp;(matched&nbsp;component)</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line259"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;If&nbsp;we&nbsp;find&nbsp;the&nbsp;matched&nbsp;node&nbsp;along&nbsp;the&nbsp;way,&nbsp;this&nbsp;is&nbsp;a&nbsp;valid&nbsp;ancestor&nbsp;element</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line260"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;If&nbsp;we&nbsp;don&#39;t&nbsp;find&nbsp;the&nbsp;matched&nbsp;node,&nbsp;we&nbsp;need&nbsp;to&nbsp;continue&nbsp;up()&nbsp;the&nbsp;component&nbsp;tree,&nbsp;as&nbsp;a&nbsp;higher&nbsp;level&nbsp;might&nbsp;have</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line261"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;what&nbsp;we&#39;re&nbsp;after</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line262"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;originalRoot&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;start</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line263"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;the&nbsp;rootEl&nbsp;is&nbsp;where&nbsp;the&nbsp;query&nbsp;started</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line264"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rootEl&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>originalRoot</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="variable other object js"><span>originalRoot</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>element</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line265"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line266"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;ensure&nbsp;that&nbsp;the&nbsp;match&nbsp;isn&#39;t&nbsp;our&nbsp;starting&nbsp;location!</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line267"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>rootEl</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>dom</span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>!==</span></span><span>&nbsp;match</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line268"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;node&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>rootEl</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>dom</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line269"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span></span></span></div><div class="line"><a name="line270"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line271"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;verify&nbsp;that&nbsp;this&nbsp;match&nbsp;is&nbsp;*above*&nbsp;the&nbsp;original&nbsp;root&nbsp;in&nbsp;the&nbsp;dom&nbsp;hierarchy</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line272"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>while</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>node</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line273"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>node&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;match</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line274"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;matching&nbsp;node&nbsp;has&nbsp;been&nbsp;located</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line275"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;node&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line276"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;verified&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language boolean true js"><span>true</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line277"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>node&nbsp;</span><span class="keyword operator comparison js"><span>!==</span></span><span>&nbsp;</span><span class="variable other object js"><span>el</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>dom</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line278"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;node&nbsp;not&nbsp;found&nbsp;yet,&nbsp;keep&nbsp;interating&nbsp;up&nbsp;the&nbsp;hierarchy</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line279"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;node&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>node</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>parentNode</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line280"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line281"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;we&#39;re&nbsp;reached&nbsp;the&nbsp;top-most&nbsp;node&nbsp;where&nbsp;a&nbsp;match&nbsp;is&nbsp;allowed&nbsp;without&nbsp;finding&nbsp;anything;&nbsp;abort</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line282"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;node&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line283"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line284"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line285"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line286"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;if&nbsp;we&nbsp;couldn&#39;t&nbsp;verify&nbsp;the&nbsp;match,&nbsp;we&nbsp;need&nbsp;to&nbsp;continue&nbsp;the&nbsp;search&nbsp;upward,&nbsp;recursively</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line287"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="keyword operator logical js"><span>!</span></span><span>verified</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line288"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>_doCompositeQuery</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>compQuery</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;domQuery</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;comp</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;direction</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;start</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line289"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line290"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line291"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line292"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>direction&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>child</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>query</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line293"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;for&nbsp;first,&nbsp;last,&nbsp;and&nbsp;child,&nbsp;we&nbsp;can&nbsp;query&nbsp;for&nbsp;matches&nbsp;on&nbsp;the&nbsp;component&nbsp;level</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line294"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rootEl&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>element</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line295"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matches&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>query</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>compQuery</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span></span></span></div><div class="line"><a name="line296"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;</span></span></span></span></div><div class="line"><a name="line297"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;now&nbsp;we&#39;ll&nbsp;loop&nbsp;over&nbsp;the&nbsp;matches,&nbsp;and&nbsp;run&nbsp;the&nbsp;appropriate&nbsp;dom&nbsp;query&nbsp;method&nbsp;on&nbsp;the&nbsp;component&#39;s&nbsp;root&nbsp;element</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line298"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>for</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>i</span><span class="keyword operator assignment js"><span>=</span></span><span class="constant numeric decimal js"><span>0</span></span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;i</span><span class="keyword operator comparison js"><span>&lt;</span></span><span class="variable other object js"><span>matches</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>length</span></span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;i</span><span class="keyword operator increment js"><span>++</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line299"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comp&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;matches</span><span class="meta brace square js"><span>[</span></span><span>i</span><span class="meta brace square js"><span>]</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line300"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>comp</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="variable other object js"><span>comp</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>element</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line301"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>get</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>el</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>down</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>domQuery</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="constant language boolean true js"><span>true</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line302"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;if&nbsp;we&nbsp;have&nbsp;a&nbsp;match,&nbsp;verify&nbsp;that&nbsp;the&nbsp;element&nbsp;is&nbsp;actually&nbsp;a&nbsp;child&nbsp;of&nbsp;the&nbsp;original&nbsp;root</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line303"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>match&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>match</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>parentNode</span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="variable other object js"><span>rootEl</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>parentNode</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>rootEl&nbsp;</span><span class="keyword operator comparison js"><span>!==</span></span><span>&nbsp;match</span><span class="meta brace round js"><span>)</span><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line304"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>break</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line305"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line306"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line307"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line308"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line309"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line310"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line311"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;match&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line312"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line313"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line314"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>_doDomQuery</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>selector</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>root</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>direction</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line315"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;target</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;parent</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;matches</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;i</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line316"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line317"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>get</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>root</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line318"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;run&nbsp;the&nbsp;appropriate&nbsp;method&nbsp;against&nbsp;the&nbsp;passed&nbsp;context&nbsp;element&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line319"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;root</span><span class="meta brace square js"><span>[</span></span><span>direction</span><span class="meta brace square js"><span>]</span></span><span class="meta brace round js"><span>(</span></span><span>selector</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="constant language boolean true js"><span>true</span></span><span class="meta brace round js"><span>)</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line320"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line321"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line322"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>_doComponentQuery</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>selector</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>root</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>direction</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line323"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;comp</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line324"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line325"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;if&nbsp;we&nbsp;have&nbsp;a&nbsp;root,&nbsp;it&#39;s&nbsp;a&nbsp;contextual&nbsp;query&nbsp;so&nbsp;we&nbsp;can&nbsp;use&nbsp;direction</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line326"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>root</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line327"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>switch</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>direction</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line328"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>case</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>up</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="keyword operator js"><span>:</span></span></span></span></span></div><div class="line"><a name="line329"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comp&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>up</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>selector</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line330"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>break</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line331"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>case</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>down</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="keyword operator js"><span>:</span></span></span></span></span></div><div class="line"><a name="line332"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comp&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>down</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>down</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>selector</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line333"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>break</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line334"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>case</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>child</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="keyword operator js"><span>:</span></span></span></span></span></div><div class="line"><a name="line335"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comp&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>child</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>child</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>selector</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line336"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>break</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line337"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line338"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line339"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;otherwise,&nbsp;fall&nbsp;back&nbsp;to&nbsp;component&nbsp;query</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line340"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line341"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comp&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>Ext</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>ComponentQuery</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>query</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>selector</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line342"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line343"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>comp&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="variable other object js"><span>comp</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>length</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line344"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>comp</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>length</span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>&gt;</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>options</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>failOnMultipleMatches</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line345"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>throw</span></span><span>&nbsp;</span><span class="meta class instance constructor"><span class="keyword operator new js"><span>new</span></span><span>&nbsp;</span><span class="entity name type instance js"><span>Error</span></span></span><span class="meta brace round js"><span>(</span></span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>Component&nbsp;Query&nbsp;locator&nbsp;matches&nbsp;multiple&nbsp;items:&nbsp;&quot;</span><span class="punctuation definition string end js"><span>&#39;</span></span></span></span></span></span></div><div class="line"><a name="line346"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword operator js"><span>+</span></span><span>&nbsp;selector&nbsp;</span><span class="keyword operator js"><span>+</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>&quot;</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line347"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line348"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line349"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comp&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;comp</span><span class="meta brace square js"><span>[</span></span><span class="constant numeric decimal js"><span>0</span></span><span class="meta brace square js"><span>]</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line350"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line351"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comp&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line352"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line353"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line354"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line355"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;comp&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line356"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line357"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line358"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>_parseRoot</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>root</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line359"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;defaultRoot&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>Locator</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>document</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line360"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="keyword operator typeof js"><span>typeof</span></span><span>&nbsp;root</span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line361"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line362"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comp</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line363"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line364"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>element</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line365"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;failedRoot</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant language boolean false js"><span>false</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line366"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;defaultRoot</span></span></span></span></div><div class="line"><a name="line367"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line368"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line369"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="keyword operator logical js"><span>!</span></span><span>root&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;root</span><span class="keyword operator comparison js"><span>===</span></span><span>defaultRoot</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line370"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>type</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line371"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line372"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>root&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;type&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>object</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line373"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;is&nbsp;an&nbsp;Ext&nbsp;JS&nbsp;/&nbsp;Sencha&nbsp;Touch&nbsp;component?</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line374"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>isComponent</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line375"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>comp</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;root</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line376"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>element</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line377"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line378"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;this&nbsp;is&nbsp;either&nbsp;an&nbsp;Ext&nbsp;JS&nbsp;element&nbsp;or&nbsp;an&nbsp;ST.Element</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line379"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>dom</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line380"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;root</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line381"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line382"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;this&nbsp;could&nbsp;be&nbsp;an&nbsp;html&nbsp;element</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line383"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>nodeType</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>nodeType</span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line384"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>get</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>root</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line385"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line386"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;this&nbsp;may&nbsp;be&nbsp;a&nbsp;future</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line387"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>$ST</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line388"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>comp</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>cmp</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line389"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>root</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line390"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line391"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line392"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;if&nbsp;it&#39;s&nbsp;a&nbsp;string,&nbsp;we&#39;ll&nbsp;try&nbsp;to&nbsp;produce&nbsp;an&nbsp;ST.Element&nbsp;from&nbsp;it</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line393"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>type&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>string</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line394"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>get</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>root</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line395"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line396"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line397"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;determine&nbsp;the&nbsp;correct&nbsp;type</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line398"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>comp</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line399"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>type</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>component</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line400"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line401"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>type</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span>&nbsp;</span><span class="keyword operator js"><span>?</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>element</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span>&nbsp;</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line402"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line403"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;if&nbsp;element&nbsp;was&nbsp;located,&nbsp;use&nbsp;it&nbsp;for&nbsp;the&nbsp;root</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line404"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line405"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>root</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>el</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>dom</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>el</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line406"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line407"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>root</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line408"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>failedRoot</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language boolean true js"><span>true</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line409"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line410"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line411"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line412"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;result</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line413"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line414"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line415"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>_parseSelector</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>selector</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>contextType</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line416"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;Ext&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>Ext</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line417"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hasCQ&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;Ext&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="variable other object js"><span>Ext</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>ComponentQuery</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line418"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selector&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;selector&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>contextType&nbsp;</span><span class="keyword operator js"><span>?</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>*</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span>&nbsp;</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line419"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;compPos&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>selector</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>indexOf</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>=&gt;</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line420"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domPos&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>selector</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>indexOf</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>&gt;&gt;</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line421"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parts</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;result</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line422"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line423"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line424"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domQuery</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line425"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;compQuery</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line426"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;isComposite</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant language boolean false js"><span>false</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line427"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selector</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;selector</span></span></span></span></div><div class="line"><a name="line428"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line429"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line430"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;context&nbsp;is&nbsp;a&nbsp;component</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line431"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>hasCQ</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line432"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>contextType&nbsp;</span><span class="keyword operator comparison js"><span>!==</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>element</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line433"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;no&nbsp;fat&nbsp;arrow&nbsp;(&gt;&gt;&nbsp;.my-class)</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line434"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>domPos&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>0</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line435"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>domQuery</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>String</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>trim</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>selector</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>replace</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>&gt;&gt;</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line436"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line437"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;fat&nbsp;arrow&nbsp;at&nbsp;beginning&nbsp;(=&gt;&nbsp;.my-class)</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line438"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>compPos&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>0</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line439"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>domQuery</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>String</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>trim</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>selector</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>replace</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>=&gt;</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line440"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line441"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;fat&nbsp;arrow&nbsp;between&nbsp;selectors&nbsp;(container&nbsp;=&gt;&nbsp;.my-class)</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line442"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>compPos&nbsp;</span><span class="keyword operator comparison js"><span>&gt;</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>0</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line443"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parts&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>selector</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>split</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>=&gt;</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line444"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>domQuery</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>String</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>trim</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>parts</span><span class="meta brace square js"><span>[</span></span><span class="constant numeric decimal js"><span>1</span></span><span class="meta brace square js"><span>]</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line445"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>compQuery</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>String</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>trim</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>parts</span><span class="meta brace square js"><span>[</span></span><span class="constant numeric decimal js"><span>0</span></span><span class="meta brace square js"><span>]</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line446"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>isComposite</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language boolean true js"><span>true</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line447"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line448"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;pure&nbsp;component&nbsp;query&nbsp;(container)</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line449"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line450"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>compQuery</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>String</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>trim</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>selector</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span></span></span></span></div><div class="line"><a name="line451"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line452"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>domPos&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="keyword operator js"><span>-</span></span><span class="constant numeric decimal js"><span>1</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;domPos&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>0</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line453"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>compPos&nbsp;</span><span class="keyword operator comparison js"><span>!==</span></span><span>&nbsp;</span><span class="keyword operator js"><span>-</span></span><span class="constant numeric decimal js"><span>1</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line454"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>throw</span></span><span>&nbsp;</span><span class="meta class instance constructor"><span class="keyword operator new js"><span>new</span></span><span>&nbsp;</span><span class="entity name type instance js"><span>Error</span></span></span><span class="meta brace round js"><span>(</span></span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>The&nbsp;specified&nbsp;composite&nbsp;query&nbsp;(&quot;</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span>&nbsp;</span><span class="keyword operator js"><span>+</span></span><span>&nbsp;selector&nbsp;</span><span class="keyword operator js"><span>+</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>&quot;)&nbsp;cannot&nbsp;be&nbsp;used&nbsp;in&nbsp;the&nbsp;current&nbsp;context</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line455"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line456"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line457"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>domQuery</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>String</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>trim</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>selector</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>replace</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>&gt;&gt;</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line458"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span></span></span></div><div class="line"><a name="line459"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line460"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;if&nbsp;component&nbsp;query&nbsp;isn&#39;t&nbsp;an&nbsp;option,&nbsp;everything&nbsp;has&nbsp;to&nbsp;funnel&nbsp;through&nbsp;dom&nbsp;query</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line461"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line462"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>result</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>domQuery</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>String</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>trim</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>selector</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>replace</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>&gt;&gt;</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line463"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span></span></span></div><div class="line"><a name="line464"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line465"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;result</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line466"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line467"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></div><div class="line"><a name="line468"><span class="source js"><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta brace round js"><span>)</span><span>(</span></span><span class="punctuation section scope begin js"><span>{</span></span><span class="punctuation section scope end js"><span>}</span></span><span class="meta brace round js"><span>)</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></div><div class="line"><a name="line469"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line470"><span class="source js"><span class="variable other object js"><span>wgxpath</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>install</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;&nbsp;</span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;polyfill&nbsp;win.document.evaluate&nbsp;for&nbsp;old&nbsp;browsers</span><span>&nbsp;</span></span></span></div><div class="line"><a name="line471"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line472"><a name="ST-method-find"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line473"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Given&nbsp;the&nbsp;`target`&nbsp;locator&nbsp;string,&nbsp;return&nbsp;the&nbsp;matching&nbsp;element&nbsp;or&nbsp;`null`&nbsp;if&nbsp;one&nbsp;is&nbsp;not</span></span></span></div><div class="line"><a name="line474"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;found.&nbsp;See&nbsp;{@link&nbsp;ST.Locator}&nbsp;for&nbsp;a&nbsp;description&nbsp;of&nbsp;valid&nbsp;locator&nbsp;strings.</span></span></span></div><div class="line"><a name="line475"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line476"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Alias&nbsp;for&nbsp;{@link&nbsp;ST.Locator#find}.</span></span></span></div><div class="line"><a name="line477"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line478"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{String}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>target</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;target&nbsp;locator&nbsp;string.</span></span></span></span></span></div><div class="line"><a name="line479"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{Boolean}&nbsp;[wrap=false]&nbsp;Pass&nbsp;`true`&nbsp;to&nbsp;return&nbsp;a&nbsp;wrapped&nbsp;{@link&nbsp;ST.Element}</span></span></span></div><div class="line"><a name="line480"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;instead&nbsp;of&nbsp;the&nbsp;raw&nbsp;DOM&nbsp;node.</span></span></span></div><div class="line"><a name="line481"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{HTMLElement/ST.Element/Ext.Component}&nbsp;[root]</span></span></span></div><div class="line"><a name="line482"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{&quot;down&quot;/&quot;up&quot;/&quot;child&quot;}&nbsp;[direction=&quot;down&quot;]</span></span></span></div><div class="line"><a name="line483"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;find</span></span></span></div><div class="line"><a name="line484"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@member</span></span><span>&nbsp;ST</span></span></span></div><div class="line"><a name="line485"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line486"><span class="source js"><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>find</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>Locator</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>find</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></div></pre>
</body>
<script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-1396058-28', 'auto');
    ga('send', 'pageview');

</script>
</html>
